﻿/*
版权所有：版权所有(C) 2011，刘建新
文件编号：M01_ResUser.cs
文件名称：ResUser.cs
系统编号：Z0003007
系统名称：通用办公系统
模块编号：M01
模块名称：信息发布
设计文档：IOA_M01信息发布XDE建模.mdx
完成日期：2011-11-20
作　　者：
内容摘要：表[Res_User]对应的实体类
*/

using System;
using System.Collections;
using System.Data;


namespace Eis51.CampanyCMS.Model.BaseInfoMng
{
		/// <summary>
		/// 类 编 号：
		/// 类 名 称：ResUser
		/// 内容摘要：
		/// </summary>
		
		[Serializable]
		public class ResUser : BaseModel
		{
		#region 自动生成代码
		
			#region 重载Equals/GetHashCode
			/// <summary>
			/// 重载Equals			
			/// </summary>
			public override bool Equals (Object obj)
			{
				if (obj != null && obj is ResUser)
				{
					if (obj == this)
						return true;
					ResUser castObj = (ResUser)obj; 
					
					if (!this.m_ResUserId.Equals(castObj.ResUserId))
						return false;
						
					if (!this.m_UserNo.Equals(castObj.UserNo))
						return false;
						
					if (!this.m_PassdWod.Equals(castObj.PassdWod))
						return false;
						
					if (!this.m_UserName.Equals(castObj.UserName))
						return false;
						
					if (!this.m_Address.Equals(castObj.Address))
						return false;
						
					if (!this.m_PostCode.Equals(castObj.PostCode))
						return false;
						
					if (!this.m_CreditLevel.Equals(castObj.CreditLevel))
						return false;
						
					if (!this.m_Msn.Equals(castObj.Msn))
						return false;
						
					if (!this.m_Qq.Equals(castObj.Qq))
						return false;
						
					if (!this.m_OfficeTel.Equals(castObj.OfficeTel))
						return false;
						
					if (!this.m_HomeTel.Equals(castObj.HomeTel))
						return false;
						
					if (!this.m_Mobile.Equals(castObj.Mobile))
						return false;
						
					if (!this.m_Email.Equals(castObj.Email))
						return false;
						
					if (!this.m_Sellerid.Equals(castObj.Sellerid))
						return false;
						
					if (!this.m_CreateDate.Equals(castObj.CreateDate))
						return false;
						
					if (!this.m_GradeIntegral.Equals(castObj.GradeIntegral))
						return false;
						
					if (!this.m_ConsumeIntegral.Equals(castObj.ConsumeIntegral))
						return false;
						
					if (!this.m_BrithDay.Equals(castObj.BrithDay))
						return false;
						
					if (!this.m_Guid.Equals(castObj.Guid))
						return false;
						
					if (!this.m_Status.Equals(castObj.Status))
						return false;
						
					if (!this.m_Myamount.Equals(castObj.Myamount))
						return false;
						
					return true;
				}
				return false;
			}
			
			/// <summary>
			/// 重载GetHashCode
			/// </summary>
			public override int GetHashCode()
			{
					int hash = 0;					
					
					hash = hash <<  8;
					if ((object)m_ResUserId != null)
					{
						hash = hash ^ m_ResUserId.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_UserNo != null)
					{
						hash = hash ^ m_UserNo.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_PassdWod != null)
					{
						hash = hash ^ m_PassdWod.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_UserName != null)
					{
						hash = hash ^ m_UserName.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Address != null)
					{
						hash = hash ^ m_Address.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_PostCode != null)
					{
						hash = hash ^ m_PostCode.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_CreditLevel != null)
					{
						hash = hash ^ m_CreditLevel.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Msn != null)
					{
						hash = hash ^ m_Msn.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Qq != null)
					{
						hash = hash ^ m_Qq.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_OfficeTel != null)
					{
						hash = hash ^ m_OfficeTel.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_HomeTel != null)
					{
						hash = hash ^ m_HomeTel.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Mobile != null)
					{
						hash = hash ^ m_Mobile.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Email != null)
					{
						hash = hash ^ m_Email.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Sellerid != null)
					{
						hash = hash ^ m_Sellerid.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_CreateDate != null)
					{
						hash = hash ^ m_CreateDate.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_GradeIntegral != null)
					{
						hash = hash ^ m_GradeIntegral.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_ConsumeIntegral != null)
					{
						hash = hash ^ m_ConsumeIntegral.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_BrithDay != null)
					{
						hash = hash ^ m_BrithDay.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Guid != null)
					{
						hash = hash ^ m_Guid.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Status != null)
					{
						hash = hash ^ m_Status.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Myamount != null)
					{
						hash = hash ^ m_Myamount.GetHashCode();
					}
						
					return hash; 
			}
			#endregion
			
			public ResUser()
			{
				MarkNew();
			}						
			
			public ResUser GetOldValue()
			{
				return OldValue as ResUser;
			}
		
		#region ResUserId属性
			private int m_ResUserId = 0;
			/// <summary>
			/// 属性名称： ResUserId
			/// 内容摘要： DB列名：Res_User_ID[]
			///            DB类型：int
			/// </summary>
			public int ResUserId
			{
				get
					{
						return m_ResUserId;
					}
				set
					{
						if (m_ResUserId as object == null || !m_ResUserId.Equals(value))
						{
							m_ResUserId = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region UserNo属性
			private string m_UserNo = String.Empty;
			/// <summary>
			/// 属性名称： UserNo
			/// 内容摘要： DB列名：User_NO[]
			///            DB类型：string
			/// </summary>
			public string UserNo
			{
				get
					{
						return m_UserNo;
					}
				set
					{
						if (m_UserNo as object == null || !m_UserNo.Equals(value))
						{
							m_UserNo = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region PassdWod属性
			private string m_PassdWod = String.Empty;
			/// <summary>
			/// 属性名称： PassdWod
			/// 内容摘要： DB列名：Passd_Wod[]
			///            DB类型：string
			/// </summary>
			public string PassdWod
			{
				get
					{
						return m_PassdWod;
					}
				set
					{
						if (m_PassdWod as object == null || !m_PassdWod.Equals(value))
						{
							m_PassdWod = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region UserName属性
			private string m_UserName = String.Empty;
			/// <summary>
			/// 属性名称： UserName
			/// 内容摘要： DB列名：User_Name[]
			///            DB类型：string
			/// </summary>
			public string UserName
			{
				get
					{
						return m_UserName;
					}
				set
					{
						if (m_UserName as object == null || !m_UserName.Equals(value))
						{
							m_UserName = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Address属性
			private string m_Address = String.Empty;
			/// <summary>
			/// 属性名称： Address
			/// 内容摘要： DB列名：Address[]
			///            DB类型：string
			/// </summary>
			public string Address
			{
				get
					{
						return m_Address;
					}
				set
					{
						if (m_Address as object == null || !m_Address.Equals(value))
						{
							m_Address = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region PostCode属性
			private string m_PostCode = String.Empty;
			/// <summary>
			/// 属性名称： PostCode
			/// 内容摘要： DB列名：post_Code[]
			///            DB类型：string
			/// </summary>
			public string PostCode
			{
				get
					{
						return m_PostCode;
					}
				set
					{
						if (m_PostCode as object == null || !m_PostCode.Equals(value))
						{
							m_PostCode = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region CreditLevel属性
			private int m_CreditLevel = 0;
			/// <summary>
			/// 属性名称： CreditLevel
			/// 内容摘要： DB列名：credit_level[]
			///            DB类型：int
			/// </summary>
			public int CreditLevel
			{
				get
					{
						return m_CreditLevel;
					}
				set
					{
						if (m_CreditLevel as object == null || !m_CreditLevel.Equals(value))
						{
							m_CreditLevel = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Msn属性
			private string m_Msn = String.Empty;
			/// <summary>
			/// 属性名称： Msn
			/// 内容摘要： DB列名：MSN[]
			///            DB类型：string
			/// </summary>
			public string Msn
			{
				get
					{
						return m_Msn;
					}
				set
					{
						if (m_Msn as object == null || !m_Msn.Equals(value))
						{
							m_Msn = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Qq属性
			private string m_Qq = String.Empty;
			/// <summary>
			/// 属性名称： Qq
			/// 内容摘要： DB列名：QQ[]
			///            DB类型：string
			/// </summary>
			public string Qq
			{
				get
					{
						return m_Qq;
					}
				set
					{
						if (m_Qq as object == null || !m_Qq.Equals(value))
						{
							m_Qq = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region OfficeTel属性
			private string m_OfficeTel = String.Empty;
			/// <summary>
			/// 属性名称： OfficeTel
			/// 内容摘要： DB列名：Office_TEL[]
			///            DB类型：string
			/// </summary>
			public string OfficeTel
			{
				get
					{
						return m_OfficeTel;
					}
				set
					{
						if (m_OfficeTel as object == null || !m_OfficeTel.Equals(value))
						{
							m_OfficeTel = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region HomeTel属性
			private string m_HomeTel = String.Empty;
			/// <summary>
			/// 属性名称： HomeTel
			/// 内容摘要： DB列名：Home_Tel[]
			///            DB类型：string
			/// </summary>
			public string HomeTel
			{
				get
					{
						return m_HomeTel;
					}
				set
					{
						if (m_HomeTel as object == null || !m_HomeTel.Equals(value))
						{
							m_HomeTel = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Mobile属性
			private string m_Mobile = String.Empty;
			/// <summary>
			/// 属性名称： Mobile
			/// 内容摘要： DB列名：Mobile[]
			///            DB类型：string
			/// </summary>
			public string Mobile
			{
				get
					{
						return m_Mobile;
					}
				set
					{
						if (m_Mobile as object == null || !m_Mobile.Equals(value))
						{
							m_Mobile = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Email属性
			private string m_Email = String.Empty;
			/// <summary>
			/// 属性名称： Email
			/// 内容摘要： DB列名：Email[]
			///            DB类型：string
			/// </summary>
			public string Email
			{
				get
					{
						return m_Email;
					}
				set
					{
						if (m_Email as object == null || !m_Email.Equals(value))
						{
							m_Email = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Sellerid属性
			private string m_Sellerid = String.Empty;
			/// <summary>
			/// 属性名称： Sellerid
			/// 内容摘要： DB列名：Sellerid[]
			///            DB类型：string
			/// </summary>
			public string Sellerid
			{
				get
					{
						return m_Sellerid;
					}
				set
					{
						if (m_Sellerid as object == null || !m_Sellerid.Equals(value))
						{
							m_Sellerid = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region CreateDate属性
			private DateTime m_CreateDate = new DateTime(1900,1,1);
			/// <summary>
			/// 属性名称： CreateDate
			/// 内容摘要： DB列名：Create_Date[]
			///            DB类型：DateTime
			/// </summary>
			public DateTime CreateDate
			{
				get
					{
						return DateTime.Parse(m_CreateDate.ToString("yyyy-MM-dd HH:mm:ss"));
					}
				set
					{
						if (m_CreateDate as object == null || !m_CreateDate.Equals(value))
						{
							m_CreateDate = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region GradeIntegral属性
			private int m_GradeIntegral = 0;
			/// <summary>
			/// 属性名称： GradeIntegral
			/// 内容摘要： DB列名：grade_integral[]
			///            DB类型：int
			/// </summary>
			public int GradeIntegral
			{
				get
					{
						return m_GradeIntegral;
					}
				set
					{
						if (m_GradeIntegral as object == null || !m_GradeIntegral.Equals(value))
						{
							m_GradeIntegral = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region ConsumeIntegral属性
			private int m_ConsumeIntegral = 0;
			/// <summary>
			/// 属性名称： ConsumeIntegral
			/// 内容摘要： DB列名：consume_integral[]
			///            DB类型：int
			/// </summary>
			public int ConsumeIntegral
			{
				get
					{
						return m_ConsumeIntegral;
					}
				set
					{
						if (m_ConsumeIntegral as object == null || !m_ConsumeIntegral.Equals(value))
						{
							m_ConsumeIntegral = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region BrithDay属性
			private DateTime m_BrithDay = new DateTime(1900,1,1);
			/// <summary>
			/// 属性名称： BrithDay
			/// 内容摘要： DB列名：Brith_Day[]
			///            DB类型：DateTime
			/// </summary>
			public DateTime BrithDay
			{
				get
					{
						return DateTime.Parse(m_BrithDay.ToString("yyyy-MM-dd HH:mm:ss"));
					}
				set
					{
						if (m_BrithDay as object == null || !m_BrithDay.Equals(value))
						{
							m_BrithDay = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Guid属性
			private string m_Guid = String.Empty;
			/// <summary>
			/// 属性名称： Guid
			/// 内容摘要： DB列名：guid[]
			///            DB类型：string
			/// </summary>
			public string Guid
			{
				get
					{
						return m_Guid;
					}
				set
					{
						if (m_Guid as object == null || !m_Guid.Equals(value))
						{
							m_Guid = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Status属性
			private int m_Status = 0;
			/// <summary>
			/// 属性名称： Status
			/// 内容摘要： DB列名：status[]
			///            DB类型：int
			/// </summary>
			public int Status
			{
				get
					{
						return m_Status;
					}
				set
					{
						if (m_Status as object == null || !m_Status.Equals(value))
						{
							m_Status = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Myamount属性
			private double m_Myamount = 0;
			/// <summary>
			/// 属性名称： Myamount
			/// 内容摘要： DB列名：MyAmount[]
			///            DB类型：double
			/// </summary>
			public double Myamount
			{
				get
					{
						return m_Myamount;
					}
				set
					{
						if (m_Myamount as object == null || !m_Myamount.Equals(value))
						{
							m_Myamount = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region static CreateDataTable/FillDataRow/DataRow2Obj/Dt2Objs/FillDataTable
			/// <summary>
			/// 得到实体对应的DataTable
			/// </summary>
			/// <param name="tableName">表名</param>
			/// <param name="cne">列名映射选择:DB列名或属性名</param>
			/// <returns>生成的DataTable</returns>
			static public DataTable CreateDataTable(string tableName,ColumnNameEnum cne)
			{
				DataTable dtResult = new DataTable(tableName);
			
				if (cne == ColumnNameEnum.DBName)
				{
					dtResult.Columns.Add(new DataColumn("Res_User_ID",typeof(int)));
					dtResult.Columns.Add(new DataColumn("User_NO",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Passd_Wod",typeof(string)));
					dtResult.Columns.Add(new DataColumn("User_Name",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Address",typeof(string)));
					dtResult.Columns.Add(new DataColumn("post_Code",typeof(string)));
					dtResult.Columns.Add(new DataColumn("credit_level",typeof(int)));
					dtResult.Columns.Add(new DataColumn("MSN",typeof(string)));
					dtResult.Columns.Add(new DataColumn("QQ",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Office_TEL",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Home_Tel",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Mobile",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Email",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Sellerid",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Create_Date",typeof(DateTime)));
					dtResult.Columns.Add(new DataColumn("grade_integral",typeof(int)));
					dtResult.Columns.Add(new DataColumn("consume_integral",typeof(int)));
					dtResult.Columns.Add(new DataColumn("Brith_Day",typeof(DateTime)));
					dtResult.Columns.Add(new DataColumn("guid",typeof(string)));
					dtResult.Columns.Add(new DataColumn("status",typeof(int)));
					dtResult.Columns.Add(new DataColumn("MyAmount",typeof(double)));
				}
				else if (cne == ColumnNameEnum.PropertyName)
				{
					dtResult.Columns.Add(new DataColumn("ResUserId",typeof(int)));
					dtResult.Columns.Add(new DataColumn("UserNo",typeof(string)));
					dtResult.Columns.Add(new DataColumn("PassdWod",typeof(string)));
					dtResult.Columns.Add(new DataColumn("UserName",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Address",typeof(string)));
					dtResult.Columns.Add(new DataColumn("PostCode",typeof(string)));
					dtResult.Columns.Add(new DataColumn("CreditLevel",typeof(int)));
					dtResult.Columns.Add(new DataColumn("Msn",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Qq",typeof(string)));
					dtResult.Columns.Add(new DataColumn("OfficeTel",typeof(string)));
					dtResult.Columns.Add(new DataColumn("HomeTel",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Mobile",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Email",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Sellerid",typeof(string)));
					dtResult.Columns.Add(new DataColumn("CreateDate",typeof(DateTime)));
					dtResult.Columns.Add(new DataColumn("GradeIntegral",typeof(int)));
					dtResult.Columns.Add(new DataColumn("ConsumeIntegral",typeof(int)));
					dtResult.Columns.Add(new DataColumn("BrithDay",typeof(DateTime)));
					dtResult.Columns.Add(new DataColumn("Guid",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Status",typeof(int)));
					dtResult.Columns.Add(new DataColumn("Myamount",typeof(double)));
				}
				return dtResult;
			}
			
			/// <summary>
			/// 得到实体对应的DataTable
			/// </summary>
			/// <param name="cne">列名映射选择:DB列名或属性名</param>
			/// <returns>生成的DataTable</returns>
			static public DataTable CreateDataTable(ColumnNameEnum cne)
			{
				return CreateDataTable(null,cne);
			}

			/// <summary>
			/// 得到实体对应的DataTable(默认列名映射为属性名)
			/// </summary>
			/// <returns>生成的DataTable</returns>
			static public DataTable CreateDataTable()
			{
				return CreateDataTable(ColumnNameEnum.PropertyName);
			}
			
			/// <summary>
			/// 用当前对象值填充DaraRow
			/// </summary>
			/// <param name="dr">由CreateTable生成的DataTable通过NewRow得到的DataRow对象</param>
			/// <param name="cne">dr的列名映射方式:DB列名或属性名</param>
			public void FillDataRow(DataRow dr,ColumnNameEnum cne)
			{
				if (dr == null)
				{
					throw new ArgumentNullException("dr");
				}
				if (ColumnNameEnum.DBName == cne)
				{
					dr["Res_User_ID"] = this.ResUserId;
					dr["User_NO"] = this.UserNo;
					dr["Passd_Wod"] = this.PassdWod;
					dr["User_Name"] = this.UserName;
					dr["Address"] = this.Address;
					dr["post_Code"] = this.PostCode;
					dr["credit_level"] = this.CreditLevel;
					dr["MSN"] = this.Msn;
					dr["QQ"] = this.Qq;
					dr["Office_TEL"] = this.OfficeTel;
					dr["Home_Tel"] = this.HomeTel;
					dr["Mobile"] = this.Mobile;
					dr["Email"] = this.Email;
					dr["Sellerid"] = this.Sellerid;
					dr["Create_Date"] = this.CreateDate;
					dr["grade_integral"] = this.GradeIntegral;
					dr["consume_integral"] = this.ConsumeIntegral;
					dr["Brith_Day"] = this.BrithDay;
					dr["guid"] = this.Guid;
					dr["status"] = this.Status;
					dr["MyAmount"] = this.Myamount;
				}
				else if (ColumnNameEnum.PropertyName == cne)
				{
					dr["ResUserId"] = this.ResUserId;
					dr["UserNo"] = this.UserNo;
					dr["PassdWod"] = this.PassdWod;
					dr["UserName"] = this.UserName;
					dr["Address"] = this.Address;
					dr["PostCode"] = this.PostCode;
					dr["CreditLevel"] = this.CreditLevel;
					dr["Msn"] = this.Msn;
					dr["Qq"] = this.Qq;
					dr["OfficeTel"] = this.OfficeTel;
					dr["HomeTel"] = this.HomeTel;
					dr["Mobile"] = this.Mobile;
					dr["Email"] = this.Email;
					dr["Sellerid"] = this.Sellerid;
					dr["CreateDate"] = this.CreateDate;
					dr["GradeIntegral"] = this.GradeIntegral;
					dr["ConsumeIntegral"] = this.ConsumeIntegral;
					dr["BrithDay"] = this.BrithDay;
					dr["Guid"] = this.Guid;
					dr["Status"] = this.Status;
					dr["Myamount"] = this.Myamount;					
				}
			}
			
			/// <summary>
			/// 用当前对象值填充DaraRow(默认列名映射为属性名)
			/// </summary>
			/// <param name="dr">由CreateTable生成的DataTable通过NewRow得到的DataRow对象</param>
			public void FillDataRow(DataRow dr)
			{
				this.FillDataRow(dr,ColumnNameEnum.PropertyName);
			}
			
			/// <summary>
			/// 将DataRow转换成ResUser对象
			/// </summary>
			/// <param name="dr">由CreateTable生成的DataTable通过NewRow得到的DataRow对象</param>
			/// <param name="cne">dr的列名映射方式:DB列名或属性名</param>
			/// <returns>ResUser对象</returns>
			public static ResUser Dr2Obj(DataRow dr,ColumnNameEnum cne)
			{
				if (dr == null)
				{
					throw new ArgumentNullException("dr");
				}
				ResUser obj = new ResUser();
				if (ColumnNameEnum.DBName == cne)
				{
					obj.ResUserId = (dr["Res_User_ID"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["Res_User_ID"],typeof(int));
					obj.UserNo = (dr["User_NO"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["User_NO"],typeof(string));
					obj.PassdWod = (dr["Passd_Wod"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Passd_Wod"],typeof(string));
					obj.UserName = (dr["User_Name"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["User_Name"],typeof(string));
					obj.Address = (dr["Address"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Address"],typeof(string));
					obj.PostCode = (dr["post_Code"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["post_Code"],typeof(string));
					obj.CreditLevel = (dr["credit_level"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["credit_level"],typeof(int));
					obj.Msn = (dr["MSN"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["MSN"],typeof(string));
					obj.Qq = (dr["QQ"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["QQ"],typeof(string));
					obj.OfficeTel = (dr["Office_TEL"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Office_TEL"],typeof(string));
					obj.HomeTel = (dr["Home_Tel"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Home_Tel"],typeof(string));
					obj.Mobile = (dr["Mobile"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Mobile"],typeof(string));
					obj.Email = (dr["Email"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Email"],typeof(string));
					obj.Sellerid = (dr["Sellerid"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Sellerid"],typeof(string));
					obj.CreateDate = (dr["Create_Date"] == Convert.DBNull) ? new DateTime(1900,1,1)  : (DateTime)Convert.ChangeType(dr["Create_Date"],typeof(DateTime));
					obj.GradeIntegral = (dr["grade_integral"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["grade_integral"],typeof(int));
					obj.ConsumeIntegral = (dr["consume_integral"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["consume_integral"],typeof(int));
					obj.BrithDay = (dr["Brith_Day"] == Convert.DBNull) ? new DateTime(1900,1,1)  : (DateTime)Convert.ChangeType(dr["Brith_Day"],typeof(DateTime));
					obj.Guid = (dr["guid"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["guid"],typeof(string));
					obj.Status = (dr["status"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["status"],typeof(int));
					obj.Myamount = (dr["MyAmount"] == Convert.DBNull) ? 0  : (double)Convert.ChangeType(dr["MyAmount"],typeof(double));
				}
				else if (ColumnNameEnum.PropertyName == cne)
				{
					obj.ResUserId = (dr["ResUserId"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["ResUserId"],typeof(int));
					obj.UserNo = (dr["UserNo"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["UserNo"],typeof(string));
					obj.PassdWod = (dr["PassdWod"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["PassdWod"],typeof(string));
					obj.UserName = (dr["UserName"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["UserName"],typeof(string));
					obj.Address = (dr["Address"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Address"],typeof(string));
					obj.PostCode = (dr["PostCode"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["PostCode"],typeof(string));
					obj.CreditLevel = (dr["CreditLevel"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["CreditLevel"],typeof(int));
					obj.Msn = (dr["Msn"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Msn"],typeof(string));
					obj.Qq = (dr["Qq"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Qq"],typeof(string));
					obj.OfficeTel = (dr["OfficeTel"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["OfficeTel"],typeof(string));
					obj.HomeTel = (dr["HomeTel"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["HomeTel"],typeof(string));
					obj.Mobile = (dr["Mobile"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Mobile"],typeof(string));
					obj.Email = (dr["Email"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Email"],typeof(string));
					obj.Sellerid = (dr["Sellerid"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Sellerid"],typeof(string));
					obj.CreateDate = (dr["CreateDate"] == Convert.DBNull) ? new DateTime(1900,1,1)  : (DateTime)Convert.ChangeType(dr["CreateDate"],typeof(DateTime));
					obj.GradeIntegral = (dr["GradeIntegral"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["GradeIntegral"],typeof(int));
					obj.ConsumeIntegral = (dr["ConsumeIntegral"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["ConsumeIntegral"],typeof(int));
					obj.BrithDay = (dr["BrithDay"] == Convert.DBNull) ? new DateTime(1900,1,1)  : (DateTime)Convert.ChangeType(dr["BrithDay"],typeof(DateTime));
					obj.Guid = (dr["Guid"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Guid"],typeof(string));
					obj.Status = (dr["Status"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["Status"],typeof(int));
					obj.Myamount = (dr["Myamount"] == Convert.DBNull) ? 0  : (double)Convert.ChangeType(dr["Myamount"],typeof(double));		
				}
				
				return obj;
			}
			
			/// <summary>
			/// 将DataRow转换成ResUser对象(默认列名映射为属性名)
			/// </summary>
			/// <returns>ResUser对象</returns>
			public static ResUser Dr2Obj(DataRow dr)
			{
				return Dr2Obj(dr,ColumnNameEnum.DBName);
			}
			
			/// <summary>
			/// 将DataTabe转换成的ResUser对象集合
			/// </summary>
			/// <param name="dt">由CreateTable生成的DataTable</param>
			/// <param name="cne">dt的列名映射方式:DB列名或属性名</param>
			/// <returns>ResUser对象的集合</returns>
			public static IList Dt2Objs(DataTable dt,ColumnNameEnum cne)
			{
				if (dt == null)
				{
					throw new ArgumentNullException("dt");
				}
				
				ArrayList alResult = new ArrayList();
				
				foreach(DataRow dr in dt.Rows)
				{
					alResult.Add(Dr2Obj(dr,cne));
				}
				
				return alResult;
			}

			/// <summary>
			/// 将DataTabe转换成的ResUser对象集合(默认列名映射为属性名)
			/// </summary>
			/// <param name="dt">由CreateTable生成的DataTable</param>
			/// <returns>ResUser对象的集合</returns>
			public static IList Dt2Objs(DataTable dt)
			{
				return Dt2Objs(dt,ColumnNameEnum.PropertyName);
			}
			
			/// <summary>
			/// 用objs的ResUser对象集合填充DataTable
			/// </summary>
			/// <param name="dt">由CreateTable生成的DataTable</param>
			/// <param name="objs">ResUser对象集合</param>
			/// <param name="cne">dt的列名映射方式:DB列名或属性名</param>
			public static void FillDataTable(DataTable dt,IList objs,ColumnNameEnum cne)
			{
				if (dt == null)
				{
					throw new ArgumentNullException("dt");
				}
				if (objs == null)
				{
					throw new ArgumentNullException("objs");
				}
				
				foreach(ResUser obj in objs)
				{
					DataRow dr = dt.NewRow();
					obj.FillDataRow(dr,cne);
					dt.Rows.Add(dr);
				}
			}

			/// <summary>
			/// 用objs的ResUser对象集合填充DataTable(默认列名映射为属性名)
			/// </summary>
			/// <param name="dt">由CreateTable生成的DataTable</param>
			/// <param name="objs">ResUser对象集合</param>
			public static void FillDataTable(DataTable dt,IList objs)
			{
				FillDataTable(dt,objs,ColumnNameEnum.PropertyName);
			}
		#endregion
		
		/// <summary>
		/// 取消编辑,恢复到上次有效调用BeginEdit前的状态,并清空保留值
		/// </summary>
		public override void CancelEdit()
		{
			ResUser old = this.OldValue as ResUser;
			if (old != null)
			{
					this.ResUserId = old.ResUserId;
					this.UserNo = old.UserNo;
					this.PassdWod = old.PassdWod;
					this.UserName = old.UserName;
					this.Address = old.Address;
					this.PostCode = old.PostCode;
					this.CreditLevel = old.CreditLevel;
					this.Msn = old.Msn;
					this.Qq = old.Qq;
					this.OfficeTel = old.OfficeTel;
					this.HomeTel = old.HomeTel;
					this.Mobile = old.Mobile;
					this.Email = old.Email;
					this.Sellerid = old.Sellerid;
					this.CreateDate = old.CreateDate;
					this.GradeIntegral = old.GradeIntegral;
					this.ConsumeIntegral = old.ConsumeIntegral;
					this.BrithDay = old.BrithDay;
					this.Guid = old.Guid;
					this.Status = old.Status;
					this.Myamount = old.Myamount;				
				this.OldValue = null;
			}
		}
		
		
		
		
		#region ResUser实体的内部Key类
			/// <summary>
			/// ResUser实体的Key类
			/// </summary>
			public sealed class Key
			{
		
				private int m_ResUserId;
				public int ResUserId
				{
 					get 
					{ 
						 return m_ResUserId; 
					}
					set 
					{ 
						m_ResUserId = value;
					}
				}
		
				public Key(int pResUserId)
				{
					m_ResUserId=pResUserId;

				}
			}
		#endregion
			/// <summary>
			/// 得到实体ResUser的PK
			/// </summary>
			public Key GetKey()
			{
				return new Key(ResUserId);				
			}
			
				
		#endregion
	}
}
